Skip to content

Add Playwright E2E test suite and fix application bugs - #24

Merged
makuchpatryk merged 3 commits into
mainfrom
copilot/verify-e2e-tests-and-fix
Feb 23, 2026
Merged

Add Playwright E2E test suite and fix application bugs#24
makuchpatryk merged 3 commits into
mainfrom
copilot/verify-e2e-tests-and-fix

Conversation

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor
  • Explore repository structure and understand codebase
  • Fix console.log('ss') debug statement in useEventGame.ts
  • Fix duplicate compatibilityDate key in nuxt.config.ts
  • Fix FinishModal title (was "Pause", now "Puzzle Complete!")
  • Add missing i18n keys: "Back to menu" and "Puzzle Complete!"
  • Install @playwright/test dependency
  • Create playwright.config.ts
  • Create tests/e2e/fixtures.ts with mockApiRoutes helper
  • Create tests/e2e/main.spec.ts (13 home page tests)
  • Create tests/e2e/advanced.spec.ts (15 game page tests)
    • Refactor level tests to use mockApiRoutes() from fixtures (removes inline duplication and ensures correct route registration order)
  • Fix JSDoc in fixtures.ts: escape ** inside block comment to avoid parse error (**\/api\/get-image**)
  • Update package.json with test:e2e, test:e2e:ui, test:e2e:debug scripts
  • Update .gitignore to exclude test-results/ and playwright-report/
  • All 28 E2E tests pass, lint passes, build passes
Original prompt

sprawdz czy wszystkie testy dzialaja jezeli cos nie dziala to popraw

The user has attached the following files from their workspace:

  • E2E_TESTS_SETUP.md

TITLE: PerplexImage - Project Summary & E2E Test Verification

USER INTENT: The user wants to verify that all E2E tests are working and fix any that are broken.

TASK DESCRIPTION:

  • Review and verify all existing E2E Playwright tests in the PerplexImage project
  • Fix any failing or broken tests
  • The project is a Nuxt 3 puzzle game that uses Pexels API for images

EXISTING:

  • Full Nuxt 3 application at /home/patryk/projects/PerplexImage/
  • E2E test suite already implemented with Playwright:
    • /home/patryk/projects/PerplexImage/tests/e2e/main.spec.ts - 31 tests
    • /home/patryk/projects/PerplexImage/tests/e2e/advanced.spec.ts - 20 tests
    • /home/patryk/projects/PerplexImage/tests/e2e/fixtures.ts - 6 custom fixtures
    • /home/patryk/projects/PerplexImage/playwright.config.ts - Playwright config
  • Project documentation:
    • /home/patryk/projects/PerplexImage/PROJECT_SUMMARY.md - 656 lines, full project summary (English)
    • /home/patryk/projects/PerplexImage/E2E_TESTS_SETUP.md
    • /home/patryk/projects/PerplexImage/tests/e2e/README.md
  • package.json updated with scripts:
    • test:e2e - runs all E2E tests
    • test:e2e:ui - interactive UI mode
    • test:e2e:debug - debug mode

PENDING:

  • Run the E2E tests to check if they pass
  • Identify failing tests
  • Fix any broken tests

CODE STATE:

/home/patryk/projects/PerplexImage/nuxt.config.ts:

export default defineNuxtConfig({
  compatibilityDate: "2024-11-10",
  app: {
    head: {
      title: "Perplex Image",
      charset: "utf-16",
      viewport: "width=device-width, initial-scale=1",
      meta: [{ name: "description", content: "Perplex Image" }],
    },
  },
  modules: [
    "@vueuse/nuxt",
    "@nuxtjs/tailwindcss",
    "@pinia/nuxt",
    "nuxt-icon",
    "@nuxtjs/i18n",
    '@nuxt/eslint',
  ],
  i18n: { vueI18n: "./i18n.config.ts" },
  compatibilityDate: "2025-06-07"
});

/home/patryk/projects/PerplexImage/modules/core/types/index.ts:

export interface ResponsePexel {
  id: string;
  media: PexelPhoto[];
  page: number;
  per_page: number;
  total_results: number;
  prev_page?: string;
  next_page?: string;
}

export interface PexelPhoto {
  alt: string;
  avg_color: string;
  height: number;
  width: number;
  id: number;
  liked: boolean;
  photographer: string;
  photographer_id: number;
  photographer_url: string;
  src: {
    landscape: string;
    large: string;
    large2x: string;
    medium: string;
    original: string;
    portrait: string;
    small: string;
    tiny: string;
    url: string;
  };
  url: string;
}

export interface ImagePieces {
  position: number;
  backgroundPosition: string;
  width: string;
  height: string;
}

export type TODO = any;

/home/patryk/projects/PerplexImage/modules/core/constants/index.ts:

export const WIDTH_GAME = 1000;

export enum LevelsKeys {
  "9x13" = "9x13",
  "15x23" = "15x23",
  "18x26" = "18x26",
}
export enum Levels {
  "9x13" = 9,
  "15x23" = 15,
  "18x26" = 18,
}

/home/patryk/projects/PerplexImage/modules/core/store/images.ts:

export const useImagesStore = defineStore({
  id: "images",
  state: (): State => ({
    selectedImage: void 0,
    photos: [],
    shuffledPieces: [],
  }),
  actions: {
    setShuffledPieces(shuffledPieces: ImagePieces[]) { ... },
    async randomSelectImage(): Promise<void> { ... },
    async setSelectedImage(image: PexelPhoto) { ... },
    async getImages() {
      const { media } = await $fetch<ResponsePexel>(`/api/get-images/?per_page=${100}`);
      this.photos = media;
      await this.setSelectedImage(media[Math.floor(Math.random() * media.length)]);
    },
    async getImage(options: { id: TODO }) {
      const image = await $fetch<PexelPhoto>(`/api/get-image/?id=${options.id}`);
      await this.setSelectedImage(image);
    },
  },
});

/home/patryk/projects/PerplexImage/server/api/get-images.ts:

export default defineEventHandler(async (event) => {
  const { per_page } = getQuery(event);
  try {
    return await $fetch<ResponsePexel>(
      `https://api.pexels.com/v1/collections/dyck2i1?per_page=${per_page}`,
      {
        headers: {
          Authorization: "ud9SuE2KtyDxsyox3rraivkqwz5VeEAqS9JBQV56fioidJFkETdDeNk1",
        },
      }
    );
  } catch (err) {
    console.error(err);
  }
  return {};
});

/home/patryk/projects/PerplexImage/modules/game/views/MainView.vue (partial):

<script setup lang="ts">
const { photos, selectedImage } = storeToRefs(useImagesStore());
const { setSelectedImage, randomSelectImage, getImages } = useImagesStore();
const selectOption = ref<LevelsKeys>(LevelsKeys["9x13"]);
const listOption = Object.values(LevelsKeys);
const isSelectImageOpened = ref(false);
const loading = ref(true);

async function beginGame() {
  if (selectedImage?.value) {
    ...

</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

@vercel

vercel Bot commented Feb 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
perplex-image Ready Ready Preview, Comment Feb 23, 2026 9:44pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@makuchpatryk
makuchpatryk requested a review from Copilot February 23, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: makuchpatryk <19875907+makuchpatryk@users.noreply.github.com>
Copilot AI changed the title [WIP] Verify and fix all E2E tests in PerplexImage project Add Playwright E2E test suite and fix application bugs Feb 23, 2026
Copilot AI requested a review from makuchpatryk February 23, 2026 21:33
@makuchpatryk
makuchpatryk requested a review from Copilot February 23, 2026 21:34
@makuchpatryk
makuchpatryk marked this pull request as ready for review February 23, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/fixtures.ts Outdated
* IMPORTANT: register the more-specific `get-image` route FIRST (lower priority)
* and `get-images` LAST (higher priority), because Playwright's last-registered
* route wins when multiple patterns match the same URL.
* `*\/api\/get-image**` would otherwise also match `get-images` requests.

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSDoc references the route glob as *\/api\/get-image**, which doesn’t match the actual patterns used below (**/api/get-image**). Updating this example would prevent confusion about which route pattern causes the overlap with get-images.

Suggested change
* `*\/api\/get-image**` would otherwise also match `get-images` requests.
* `**/api/get-image**` would otherwise also match `get-images` requests.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in be91ce3 — escaped the ** inside the block comment as **\/api\/get-image** to prevent the parser from treating it as a block comment terminator.

Comment thread tests/e2e/advanced.spec.ts Outdated
Co-authored-by: makuchpatryk <19875907+makuchpatryk@users.noreply.github.com>

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.iconify.design
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --enable-source-maps /home/REDACTED/work/perplex-image/perplex-image/node_modules/.pnpm/nuxi@3.15.0/node_modules/nuxi/bin/nuxi.mjs _dev (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl rgo/bin/git (dns block)
  • api.pexels.com
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --enable-source-maps /home/REDACTED/work/perplex-image/perplex-image/node_modules/.pnpm/nuxi@3.15.0/node_modules/nuxi/bin/nuxi.mjs _dev (dns block)
  • api.simplesvg.com
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --enable-source-maps /home/REDACTED/work/perplex-image/perplex-image/node_modules/.pnpm/nuxi@3.15.0/node_modules/nuxi/bin/nuxi.mjs _dev (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl rgo/bin/git (dns block)
  • api.unisvg.com
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --enable-source-maps /home/REDACTED/work/perplex-image/perplex-image/node_modules/.pnpm/nuxi@3.15.0/node_modules/nuxi/bin/nuxi.mjs _dev (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl rgo/bin/git (dns block)
  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl rgo/bin/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from makuchpatryk February 23, 2026 21:44
@makuchpatryk
makuchpatryk merged commit b4bdfda into main Feb 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants